<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<h:head>
	<link rel="stylesheet"
		href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
	</link>
	<title>Activity planner - edit user</title>

</h:head>

<h:body>

	<h1>#{userBean.currentUser.name}</h1>

	<h:form class="text-info"
		action="#{userBean.saveAction(userBean.currentUser)}" method="POST">
		<table>

			<tr>
				<td><label path="login"> Login </label></td>
				<td><h:inputText id="login"
						value="#{userBean.currentUser.login}" size="20" required="true"
						label="Login">
					</h:inputText></td>
			</tr>
			<tr>
				<td><label path="password"> Password </label></td>
				<td><h:inputSecret id="password"
						value="#{userBean.currentUser.password}" size="20"
						required="false" label="Password">
					</h:inputSecret></td>
			</tr>
			<tr>
				<td><label path="name"> Name </label></td>
				<td><h:inputText id="name" value="#{userBean.currentUser.name}"
						size="20" required="false" label="Name">
					</h:inputText></td>
			</tr>
			<tr>
				<td><label path="email"> Email </label></td>
				<td><h:inputText id="email"
						value="#{userBean.currentUser.email}" size="20" required="false"
						label="Email">
					</h:inputText></td>
			</tr>
			<tr>
				<h:panelGroup rendered="#{userBean.currentUser.role=='admin'}">
					<td><label path="email"> Role </label></td>
					<td><h:inputText id="role"
							value="#{userBean.currentUser.role}" size="20" required="false"
							label="Role">
						</h:inputText></td>
				</h:panelGroup>
			</tr>
			<tr>
				<h:panelGroup rendered="#{userBean.currentUser.role=='admin'}">
					<td><label path="status"> Status </label></td>
					<td><h:inputText id="status"
							value="#{userBean.currentUser.status}" size="20" required="false"
							label="Status">
						</h:inputText></td>
				</h:panelGroup>
			</tr>
			<tr>
				<td><h:commandButton value="Save" class="btn-info btn"
						action="#{userBean.saveAction(userBean.currentUser)}" /></td>
			</tr>
		</table>
	</h:form>

</h:body>
</html>